package com.haiya.scg.learning.factory;

import com.haiya.scg.learning.filter.UserIdCheckLocalFilter;
import org.springframework.cloud.gateway.filter.GatewayFilter;
import org.springframework.cloud.gateway.filter.factory.AbstractGatewayFilterFactory;
import org.springframework.stereotype.Component;

/**
 * 加入到过滤器工厂，并且注册到Spring容器中
 * @author qiaoguoqiang
 */
@Component
public class UserIdCheckGatewayFilterFactory extends AbstractGatewayFilterFactory {
    @Override
    public GatewayFilter apply(Object config) {
        return new UserIdCheckLocalFilter();
    }
}
